<!--
 * @Author: your name
 * @Date: 2020-09-14 10:53:05
 * @LastEditTime: 2020-12-29 12:18:10
 * @LastEditors: Please set LastEditors
 * @Description: In User Settings Edit
 * @FilePath: \face-recognition\src\App.vue
-->
<style lang="less">
@import '//at.alicdn.com/t/font_2176663_npd7sbnpht9.css';
#app {
  font: 12px/1 "微软雅黑", "Avenir", Helvetica, Arial, sans-serif, "Segoe UI",
    "Helvetica Neue", "PingFang SC", "Noto Sans", "Noto Sans CJK SC",
    "Microsoft YaHei";
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  line-height: 1;
}
* {
  padding: 0;
  margin: 0;
}
i,
em {
  font-style: normal;
}
li {
  list-style: none;
}
img {
  border: none;
}
a {
  text-decoration: none;
}
.clearfix {
  *zoom: 1;
}
.clearfix:after {
  display: block;
  overflow: hidden;
  clear: both;
  height: 0;
  visibility: hidden;
  content: ".";
}
input,
textarea {
  outline: 0;
  outline: none;
}
input[type="submit"] {
  cursor: pointer;
}
.fl {
  float: left;
}
.fr {
  float: right;
}
.mt1200 {
  width: 1200px;
  min-width: 1200px;
  margin: 0 auto;
}
.wh-inherit {
  width: inherit;
  height: inherit;
}
h2,
h3,
h4 {
  font-weight: normal;
}

// ----------------------------------------------全局修改element.css---------------------------------------
.el-form--inline .el-form-item {
  margin-right: 40px !important;
}
.el-button [class*="el-icon-"] + span {
  margin-left: 5px;
}
.el-form {
  margin-bottom: 30px;
}
.el-pagination {
  margin-top: 30px;
  justify-content: center;
  display: flex;
}
.el-popper .el-popconfirm .el-popconfirm__action {
  padding-top: 8px !important;
}
.el-pagination {
  padding-bottom: 50px!important;
}
.el-table__empty-text {
  line-height: inherit!important;
}

// 图片上传检索动画
@-webkit-keyframes scan {
    0% {
        height: 0
    }
    to {
        opacity: 0;
        height: 600px
    }
}
@-moz-keyframes scan {
    0% {
        height: 0
    }
    to {
        opacity: 0;
        height: 600px
    }
}
@keyframes scan {
    0% {
        height: 0
    }
    to {
        opacity: 0;
        height: 600px
    }
}

// 版权
.copyright {
  text-align: center;
  color: #999;
  text-align: center;
  line-height: 40px;
  font-size: 12px;
}

// 设置进度条色值
#nprogress .bar {
 background: #67C23A !important;
}

// 更改iconfont字体
.icon-kong {
  font-size: 30px;
  color: #C0C4CC;
  display: block;
 margin-bottom: 2px;
}
</style>

<template>
  <div id="app">
   <el-backtop></el-backtop>
   <router-view />
  </div>
</template>

<script>
import { getToken } from '@/utils/auth'
export default {
  name: "App",
  watch: {
    $route: {
      handler(val) {
        let token = getToken()
        if (!token || token == null || token == undefined) {
            this.$router.push({ path: "/" }) 
        } else {
            if (val.path == "/") {
            this.$router.push({
              path: "/home",
            })
          }
            }
      },
      deep: true
    }
  }
}
</script>